#ifndef Segmentation_H
#define Segmentation_H


//!Includes


#include "Aria.h"
#include "ArNetworking.h"
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
//!Defines
#define filterHue pHue[i+j*h_plane->widthStep]>=HueLow&&pHue[i+j*h_plane->widthStep]<=HueHigh
#define filterVal pVal[i+j*h_plane->widthStep]>=ValLow&&pVal[i+j*h_plane->widthStep]<=ValHigh
#define filterSat pSat[i+j*h_plane->widthStep]>=SatLow&&pSat[i+j*h_plane->widthStep]<=SatHigh

//!Global Functions


namespace algorithms
{

/**
 * class Segmentation
 *
 * Autor:David Bevilaqua
 *
 * DESCRIPTION:
 *
 */

class Segmentation
{
public:

	//!Enums



	//!Constructors/Destructors

	/**
	 * Empty Constructor
	 */
	Segmentation ( );

	/**
	 * Empty Destructor
	 */

	~Segmentation ( );

	//!Public Attributes




	//!Public Accessor Methods

	void SetSourceImage(IplImage *SourceImage);
	void SetDestinImage(IplImage *DestinImage);
	void SetTarget(CvBox2D *pBox);
	void ClearTargetPoints( );
	IplImage *GetDestinImage( );
	IplImage *GetSourceImage( );
	CvBox2D  GetTarget( );
	std::vector <CvPoint>  GetTargetPoints( );

	//!Public Methods
	bool FindTarget( );
	bool FindTargetPoints( );
	void Execute ( );


protected:

	//!Protected Attributes



	//!Protected Methods


private:

	//!Private Attributes
	IplImage *m_pSourceImage;
	IplImage *m_pDestinImage;
	CvBox2D *m_pBox;
	CvBox2D m_BoxTemp;
	int m_nContours;
	std::vector <CvPoint> m_TargetPoints;
	//!Private Methods
	void initAttributes ( );


};

};

#endif
